﻿using System;

namespace ScrumBox.Model
{
    /// <summary>
    /// Represents a task which is taken from a sprint backlog item.
    /// </summary>
    public class Task
    {
        private readonly User _user;
        private int _estimatedHours;
        private SprintBackLogItem _sprintBackLogItem;
        private DateTime _startDate;
        private string _title;

        /// <summary>
        /// 
        /// </summary>
        public Task()
        {
        }

        public Task(string title)
        {
            _title = title;
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="title"></param>
        /// <param name="user"></param>
        /// <param name="estimatedHours"></param>
        /// <param name="startDate"></param>
        /// <param name="sprintBackLogItem"></param>
        public Task(string title, User user, int estimatedHours, DateTime startDate, SprintBackLogItem sprintBackLogItem)
        {
            _title = title;
            _user = user;
            _estimatedHours = estimatedHours;
            _startDate = startDate;
            _sprintBackLogItem = sprintBackLogItem;
        }

        /// <summary>
        /// User to complete this task.
        /// </summary>
        public virtual User User
        {
            get { return _user; }
        }

        /// <summary>
        /// EstimatedHours
        /// </summary>
        public virtual int EstimatedHours
        {
            get { return _estimatedHours; }
            set { _estimatedHours = value; }
        }

        /// <summary>
        /// StartDate
        /// </summary>
        public virtual DateTime StartDate
        {
            get { return _startDate; }
            set { _startDate = value; }
        }

        /// <summary>
        /// The associated sprint backlog item
        /// </summary>
        public virtual SprintBackLogItem SprintBackLogItem
        {
            get { return _sprintBackLogItem; }
            set { _sprintBackLogItem = value; }
        }

        /// <summary>
        /// The title of the task
        /// </summary>
        public virtual string Title
        {
            get { return _title; }
            set { _title = value; }
        }
    }
}